package server.business.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import server.business.converter.BackBloodReasonConverter;


import java.io.Serializable;
import java.util.Date;

/**
 * 患者退血信息表
 *
 * @Author 赵越
 * @TableName patient_back_information
 * @Time 2022-08-03
 */
@TableName(value = "patient_back_information")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PatientBackInformation implements Serializable {
    /**
     * 编号
     */
    @ExcelProperty("编号")
    @ColumnWidth(10)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 创建时间
     */
    @ExcelIgnore
    @TableField(value = "gmt_create")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @ExcelIgnore
    @TableField(value = "gmt_modified")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified;

    /**
     * 退血单号
     */
    @ExcelProperty("退血单号")
    @ColumnWidth(10)
    @TableField(value = "back_information_number")
    private String backInformationNumber;

    /**
     * 患者信息表中的患者id
     */
    @ExcelProperty("患者Id")
    @ColumnWidth(10)
    @TableField(value = "patient_id")
    private String patientId;

    /**
     * 输血申请单号
     */
    @ExcelProperty("输血申请单号")
    @ColumnWidth(10)
    @TableField(value = "transfusion_number")
    private String transfusionNumber;

    /**
     * 退血原因
     */
    @ExcelProperty(value = "退血原因", converter = BackBloodReasonConverter.class)
    @ColumnWidth(30)
    @TableField(value = "back_blood_reason")
    private String backBloodReason;

    /**
     * 申请人姓名
     */
    @ExcelProperty("申请人姓名")
    @ColumnWidth(10)
    @TableField(value = "applicant_name")
    private String applicantName;

    /**
     * 申请人工号
     */
    @ExcelProperty("申请人工号")
    @ColumnWidth(10)
    @TableField(value = "applicant_work_number")
    private String applicantWorkNumber;

    /**
     * 申请时间
     */
    @ExcelProperty("申请时间")
    @ColumnWidth(20)
    @TableField(value = "apply_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date applyTime;

    /**
     * 审核人姓名
     */
    @ExcelProperty("申请审核人姓名")
    @ColumnWidth(10)
    @TableField(value = "auditor")
    private String auditor;

    /**
     * 审核时间
     */
    @ExcelProperty("审核时间")
    @ColumnWidth(20)
    @TableField(value = "audit_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    private Date auditTime;

    /**
     * 审核人工号
     */
    @ExcelProperty("审核人工号")
    @ColumnWidth(10)
    @TableField(value = "auditor_number")
    private String auditorNumber;

    /**
     * 退款金额
     */
    @ExcelProperty("退款金额")
    @ColumnWidth(10)
    @TableField(value = "refund_amount")
    private Integer refundAmount;

    /**
     * 退款操作人姓名
     */
    @ExcelProperty("退款操作人姓名")
    @ColumnWidth(10)
    @TableField(value = "refund_operator")
    private String refundOperator;

    /**
     * 退款完成时间
     */
    @ExcelProperty("退款完成时间")
    @ColumnWidth(20)
    @TableField(value = "refund_finish_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    private Date refundFinishTime;

    /**
     * 退款操作人工号
     */
    @ExcelProperty("退款操作人工号")
    @ColumnWidth(10)
    @TableField(value = "refund_operator_number")
    private String refundOperatorNumber;

    /**
     * 收款人姓名
     */
    @ExcelProperty("收款人姓名")
    @ColumnWidth(10)
    @TableField(value = "payee_name")
    private String payeeName;

    /**
     * 收款人身份证号
     */
    @ExcelProperty("收款人身份证号")
    @ColumnWidth(10)
    @TableField(value = "payee_idcard")
    private String payeeIdcard;

    @TableField(exist = false)
    private static final long serialVersionUID = -8653533512174602381L;
}